<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>AUI快速完成布局</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <style type="text/css">
        #left,
        #right {
            background-color: #ffffff;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        #right {
            background-color: transparent;
        }
        .aui-list-item.aui-active {
            background-color: #b6dffd;
            color: #fff;
        }
    </style>
 <script >

</script>
</head>
<body>
    <div class="aui-content">
        <div class="aui-row">
            <div class="aui-col-xs-3 aui-border-r" id="left">
                <ul class="aui-list aui-list-noborder aui-margin-b-0" id="leftTab">
                    <li data-id="1" class="aui-list-item aui-active">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="2" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="3" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="4" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="5" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="6" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="7" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="8" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="9" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>
                    <li data-id="10" class="aui-list-item">
                        <div class="aui-list-item-inner">
                            Item3
                        </div>
                    </li>

                </ul>
            </div>
            <div class="aui-col-xs-9" id="right">
                <div size-id='1' class="aui-card-list>
                    <div class="aui-card-list-header">
                        1卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='2' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        2卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='3' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        3卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='4' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='5' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='6' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='7' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='8' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='9' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
                <div size-id='10' class="aui-card-list aui-hide">
                    <div class="aui-card-list-header">
                        卡片布局头部区域
                    </div>
                    <div class="aui-card-list-content-padded">
                        内容区域，卡片列表布局样式可以实现APP中常见的各类样式
                    </div>
                    <div class="aui-card-list-footer">
                        底部区域
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js" ></script>
<script type="text/javascript">
    document.getElementById("left").style.height = window.innerHeight+"px";
    document.getElementById("right").style.height = window.innerHeight+"px";
     var leftTab = document.querySelectorAll('#leftTab > li');
        //console.log(leftTab);
        for (var i =0;i<leftTab.length;i++){
            leftTab[i].onclick=function(){
                var dataId = parseInt(this.getAttribute('data-id'));
                $.ajax({
                    url:,
                    success:function(){

                    }
                })
                console.log(dataId);
                 if(document.querySelector('div[size-id="'+dataId+'"]').className.indexOf('aui-hide')>-1){
                    document.querySelector('div[size-id="'+dataId+'"]').remove('aui-hide');
                }else{
                    //addHide()
                    document.querySelector('div[size-id="'+dataId+'"]').add('aui-hide');
                }
                if(this.className.indexOf('aui-active')>-1){

                    this.classList.remove('aui-active');
                }else{
                    clearActive();
                    this.classList.add('aui-active');
                }
            }
        }
    function clearActive(){
        var leftTab = document.querySelectorAll('#leftTab> li')
        for(var i = 0;i<leftTab.length;i++){
                leftTab[i].classList.remove('aui-active');
            }
    }
    function addHide(){
        var rightHide = document.querySelectorAll('#right>.aui-card-list')
        for(var i = 0;i<rightHide.length;i++){
                rightHide[i].classList.add('aui-hide');
            }
    }

</script>
</html>